<?php


namespace app\admin\model;


use think\Model;

class AdminModel extends Model
{
    protected $type = [
        'id'=>'integer',
        'status'=>'integer'
    ];


    public function setPasswordAttr($val)
    {
        return password_hash($val, PASSWORD_DEFAULT);
    }


    /**
     * 密码校验
     * @param string $pass
     * @return bool
     */
    public function verifyPassword(string $pass)
    {
        return password_verify($pass, $this->getData('password'));
    }


}
